﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace LogSystem
{
    public class Logging
    {
     
            private readonly ILogger _logger;
            private readonly LogSubject _logSubject;
         

            
            public  Logging(string loggerType)
            {
                _logger = LoggerFactory.CreateLogger(loggerType);
                _logSubject = new LogSubject();
            }

            public void AddObserver(ILogObserver observer)
            {
                _logSubject.AddObserver(observer);
            }

            public void LogMessage(string message)
            {
                _logger.Log(message);
                _logSubject.NotifyObservers(message);
            }
        }
    }

